package com.example.javasystem.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.javasystem.entity.ETable;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ETableMapper extends BaseMapper<ETable> {
    // 查找没有处理过的数据
    @Select("select * from external_table where tank_number > 0 and status = " + ETable.STATUS_UNPROCESSED)
    List<ETable> queryUnTreatedData();

    // 根据id值修改对应的处理状态
    @Update("update external_table set status = " +  ETable.STATUS_PROCESSED +" where id = #{id}")
    int updateStatusById(Long id);
}
